<template>
    <div>
    <ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media" v-for="item in newslist" :key="item.id">
					<router-link :to="'/home/newsinfo/'+item.id">
						<img class="mui-media-object mui-pull-left" :src="item.img_url">
						<div class="mui-media-body">
							<h1>{{item.title}}</h1>
							<p class='mui-ellipsis'>
                               <span>发表时间:{{item.add_time}}</span>
                                  <span>点击:{{item.click}}次</span>
                            </p>
						</div>
					</router-link>
				</li>
		
					
			</ul>
    </div>
</template>


<script>
import { Toast } from "mint-ui";
export default {
  data() {
    newslist: [];
  },
  created() {
    this.getNewsList();
  },
  methods: {
    getNewsList() {
      this.newslist = [
        {
          add_time: "2018-10-24 12:12:12",
          click: 1,
          id: 13,
          img_url:
            "http://img.hao661.com/qq.hao661.com/uploads/allimg/180717/134432F64-2.jpg",
          title: "一季度财报增加",
          zhaiyao: "公司财报"
        },
        {
          add_time: "2018-10-24 12:12:12",
          click: 25,
          id: 14,
          img_url:
            "http://img.hao661.com/qq.hao661.com/uploads/allimg/180717/134432F64-2.jpg",
          title: "二季度财报增加",
          zhaiyao: "公司财报1"
        },
        {
          add_time: "2018-10-24 12:12:12",
          click: 18,
          id: 15,
          img_url:
            "http://img.hao661.com/qq.hao661.com/uploads/allimg/180717/134432F64-2.jpg",
          title: "三季度财报增加",
          zhaiyao: "公司财报2"
        },
        {
          add_time: "2018-10-24 12:12:12",
          click: 17,
          id: 16,
          img_url:
            "http://img.hao661.com/qq.hao661.com/uploads/allimg/180717/134432F64-2.jpg",
          title: "四季度财报增加",
          zhaiyao: "公司财报3"
        },
        {
          add_time: "2018-10-24 12:12:12",
          click: 25,
          id: 17,
          img_url:
            "http://img.hao661.com/qq.hao661.com/uploads/allimg/180717/134432F64-2.jpg",
          title: "二季度财报增加",
          zhaiyao: "公司财报1"
        },
        {
          add_time: "2018-10-24 12:12:12",
          click: 25,
          id: 18,
          img_url:
            "http://img.hao661.com/qq.hao661.com/uploads/allimg/180717/134432F64-2.jpg",
          title: "二季度财报增加",
          zhaiyao: "公司财报1"
        },
        {
          add_time: "2018-10-24 12:12:12",
          click: 25,
          id: 19,
          img_url:
            "http://img.hao661.com/qq.hao661.com/uploads/allimg/180717/134432F64-2.jpg",
          title: "二季度财报增加",
          zhaiyao: "公司财报1"
        },
        {
          add_time: "2018-10-24 12:12:12",
          click: 25,
          id: 20,
          img_url:
            "http://img.hao661.com/qq.hao661.com/uploads/allimg/180717/134432F64-2.jpg",
          title: "二季度财报增加",
          zhaiyao: "公司财报1"
        },
        {
          add_time: "2018-10-24 12:12:12",
          click: 25,
          id: 21,
          img_url:
            "http://img.hao661.com/qq.hao661.com/uploads/allimg/180717/134432F64-2.jpg",
          title: "二季度财报增加",
          zhaiyao: "公司财报1"
        },
        {
          add_time: "2018-10-24 12:12:12",
          click: 25,
          id: 22,
          img_url:
            "http://img.hao661.com/qq.hao661.com/uploads/allimg/180717/134432F64-2.jpg",
          title: "二季度财报增加",
          zhaiyao: "公司财报1"
        },
        {
          add_time: "2018-10-24 12:12:12",
          click: 25,
          id: 23,
          img_url:
            "http://img.hao661.com/qq.hao661.com/uploads/allimg/180717/134432F64-2.jpg",
          title: "二季度财报增加",
          zhaiyao: "公司财报1"
        },
        {
          add_time: "2018-10-24 12:12:12",
          click: 25,
          id: 24,
          img_url:
            "http://img.hao661.com/qq.hao661.com/uploads/allimg/180717/134432F64-2.jpg",
          title: "二季度财报增加",
          zhaiyao: "公司财报1"
        },
        {
          add_time: "2018-10-24 12:12:12",
          click: 25,
          id: 25,
          img_url:
            "http://img.hao661.com/qq.hao661.com/uploads/allimg/180717/134432F64-2.jpg",
          title: "二季度财报增加",
          zhaiyao: "公司财报1"
        }
      ];
      this.$http
        .get("https://www.baidu.com/?tn=62095104_7_oem_dg")
        .then(result => {
          console.log(result);
          Toast("获取新闻成功");
        });
    }
  }
};
</script>

<style lang="scss" scoped>
.mui-table-view {
  li {
    h1 {
      font-size: 14px;
    }

    .mui-ellipsis {
      font-size: 12px;
      color: #226aff;
      display: flex;
      justify-content: space-between;
    }
  }
}
</style>

